import request from '@/utils/request'
// 先 相当于java的类注意,对接后端接口
//  在 去view写teacher.vue 定义模块
// 1
export default {

  // 更新讲师信息
  updateById(teacher) {
    return request({
      url: '/admin/edu/teacher/update',
      method: 'put',
      data: teacher
    })
  },
  // 根据id查询
  getById(id) {
    return request({
      url: `/admin/edu/teacher/get/${id}`,
      method: 'get'
    })
  },

  // 新增教师
  save(teacher) {
    return request({
      url: '/admin/edu/teacher/save',
      method: 'post',
      data: teacher
    })
  },

  // 根据id删除教师
  removeById(id) {
    return request({
      url: `/admin/edu/teacher/remove/${id}`,
      method: 'delete'
    })
  },

  // 获取所有教师
  list() {
    return request({
      url: '/admin/edu/teacher/list',
      method: 'get'
      // get字符串传
    //  params:
      // json传
      //   data:
    })
  },
  // 按条件和分页获取列表
  pageList(page, limit, searchObj) {
    return request({
      url: `/admin/edu/teacher/queryListPage/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  }
}
